package com.qipay.order.service.impl;

import com.qipay.baas.model.*;
import com.qipay.mapper.OrderInfoMapper;
import com.qipay.order.service.OrderInfoService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * Creator: Yao
 * Date:    2017/9/21
 * For:
 * Other:
 */
@Service
public class OrderInfoServiceImpl implements OrderInfoService {

    protected final Log logger = LogFactory.getLog(this.getClass());

    @Autowired
    OrderInfoMapper orderMapper;



    @Override
    public List<OrderInfo> getAll() {
        List<OrderInfo> orderInfos = orderMapper.selectAll();
        if (orderInfos == null || orderInfos.size() == 0) {
            return null;
        }
        return orderInfos;
    }

    @Override
    public int updateByMark(String mark) {
        return orderMapper.updateByMark(mark);
    }

    @Override
    public OrderInfo insert(OrderInfo orderInfo) {
        orderMapper.insert(orderInfo);
        orderInfo.getId();
        return orderInfo;
    }

}
